* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: #fada3e;
}

.container {
  position: relative;
  width: 1000px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.container .card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.container .card:nth-child(even) {
  flex-direction: column-reverse;
}

.container .card .imgBx {
  position: relative;
  width: 250px;
  height: 250px;
  background-color: #000;
}

.container .card .imgBx img {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.container .card .content {
  position: relative;
  width: 250px;
  height: 250px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container .card .content div {
  padding: 20px;
  text-align: center;
}

@media (max-width:1000px) {
  .container {
    grid-template-columns: repeat(auto-fit, minmax(100%, 1fr));
    margin: 50px;
  }
  .container .card{
    flex-direction: row;
    margin: 10px 0;
  }
  .container .card:nth-child(even){
    flex-direction: row-reverse;
    margin: 10px 0;
  }
  .container .card .imgBx,
  .container .card .content{
    width: 50%;
  }
}
@media (max-width:600px) {
  .container .card{
    flex-direction: column;
    margin: 10px 0;
  }
  .container .card:nth-child(even){
    flex-direction: column;
    margin: 10px 0;
  }
  .container .card .imgBx,
  .container .card .content{
    width: 100%;
  }
}
